import Vue from 'vue'
import Router from 'vue-router'
// import home from '@/views/home'
import fixBottom from '@/components/fixBottom'
import home from '@/views/home'
import login from '@/views/login'
import activity from '@/views/activity'
import data from '@/views/data'
import Extension from '@/views/Extension/route.js'
import setup from '@/views/setup/route.js'
import Finance from '@/views/Finance/route.js'
import Luckdraw from '@/views/Luckdraw'
import notice from '@/views/notice'
import novellist from '@/views/novellist/route.js'
import order from '@/views/order'
import signin from '@/views/signin'
import error404 from '@/views/error404'

Vue.use(Router)

export default new Router({
  routes: [
    // {
    //     path: '/',
    //     redirect: '/my',
    // },
    // {
    //     path: '/home',
    //     name: 'home',
    //     component: home
    // },
    {
      path: '*',
      component: error404, //找不到页面
    },
    //登录,
    {
      path: '/',
      name: 'login',
      component: login
    },

    {
       //home
      path: '/home',
      name: 'home',
      component: home,
      redirect:'/home/activity',
      children: [{
        //数据统计
        path: 'data',
        name: 'data',
        component: data,
      }, {
        //抽奖管理
        path: 'Luckdraw',
        name: 'Luckdraw',
        component: Luckdraw,
      }, {
        //通知
        path: 'notice',
        name: 'notice',
        component: notice,
      }, {
        //订单管理
        path: 'order',
        name: 'order',
        component: order,
      }, {
        //签到管理
        path: 'signin',
        name: 'signin',
        component: signin,
      }, {
        //通知公告
        path: 'activity',
        name: 'activity',
        component: activity,
      },
      ...novellist,
      ...setup,
      ...Extension,
      ...Finance
    ]
    },
  ],
  // mode: 'history'
})
